//
//  AddressCell.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/25.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "AddressCell.h"
#import "DefaultChooseView.h"
@implementation AddressCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = 0;

    }
    return self;
}

- (void)loadCellDic:(NSDictionary *)dataDic Row:(NSInteger *)row
{
    if (!_nameLab) {
        
        //名字
        _nameLab = [UILabel new];
        [self.contentView addSubview:_nameLab];
        _nameLab.font = [UIFont systemFontOfSize:15*screenW_6];
        _nameLab.textColor  = TextBlack;
        _nameLab.numberOfLines = 0;
        [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15*screenW_6);
            make.width.equalTo(@(SCREENW-50*screenW_6));
            make.top.equalTo(self.contentView).offset(15*screenW_6);
        }];
        
        //箭头 My_arrow
        _arrowImageV = [UIImageView new];
        [self.contentView addSubview:_arrowImageV];
        _arrowImageV.image = [UIImage imageNamed:@"My_arrow"];
        [_arrowImageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(@(-15*screenW_6));
            make.top.equalTo(self.contentView).offset(15*screenW_6);
            make.width.equalTo(@(8*screenW_6));
            make.height.equalTo(@(14*screenW_6));
        }];
        
        //描述discribLab
        _discribLab = [UILabel new];
        [self.contentView addSubview:_discribLab];
        _discribLab.font = [UIFont systemFontOfSize:12*screenW_6];
        _discribLab.textColor  = TextGray;
        _discribLab.numberOfLines = 0;
        [_discribLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.nameLab.mas_bottom).offset(10*screenW_6);
            make.left.equalTo(self.contentView).offset(15*screenW_6);
            make.right.equalTo(@(-35*screenW_6));
        }];
        
        //线条
        _lineLab = [UILabel new];
        [self.contentView addSubview:_lineLab];
        _lineLab.backgroundColor = LineColor;
        [_lineLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.equalTo(@1);
            make.left.equalTo(@(15*screenW_6));
            make.right.equalTo(@0);
            make.top.equalTo(self.discribLab.mas_bottom).offset(15*screenW_6);
        }];

        
        //默认选择栏
        _deaultView = [[DefaultChooseView alloc]initWithFrame:CGRectMake(0, 0, SCREENW, 50*screenW_6) IsSelect:row==0?YES:NO];
        [self.contentView addSubview:_deaultView];
        [_deaultView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.equalTo(@(50*screenW_6));
            make.left.equalTo(@(0));
            make.right.equalTo(@0);
            make.top.equalTo(self.lineLab.mas_bottom).offset(0);
            make.bottom.equalTo(self.contentView.mas_bottom).offset(0);
        }];
        __weak typeof(self)weakself = self;
        _deaultView.selectBlock = ^(NSInteger selectNumber){
            if (weakself.chooseBlock) {//回调选择的按钮
                weakself.chooseBlock(selectNumber);
            }
        };
        
    }
    
    //数据jiazai
    _nameLab.text = @"洪山区光谷大道未来之光停车场";
    _discribLab.text = @"未来之光1305";

}
@end
